# try ... except...else 结构
# 如果try块中没有抛出异常，则执行else块
# 如果try中抛出异常，则责执行except块
try:
    a = int(input('请输入第一个数字'))
    b = int(input('请输入第二个数字'))
    shuzhi = a/b
except BaseException as x:
    print('报错')
else:
    print('计算结果为：', shuzhi)


# try ... except...else...finally 结构
# finally 不管上述的代码是否出错都将执行接下来的块
try:
    a = int(input('请输入第一个数字'))
    b = int(input('请输入第二个数字'))
    shuzhi = a/b
except BaseException as x:
    print('报错')
else:
    print('计算结果为：', shuzhi)
finally:
    print('感谢使用')
